package org.example.创建型模式.单例模式.基层;

public class 双重锁校验_线程安全 {

    private static volatile 双重锁校验_线程安全 instance;

    private 双重锁校验_线程安全() {
    }

    public static 双重锁校验_线程安全 getInstance(){
       if(null != instance) return instance;
       synchronized (双重锁校验_线程安全.class){
           if (null == instance){
               instance = new 双重锁校验_线程安全();
           }
       }
       return instance;
    }

}
